Check pointers before xfree.
authoroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 11 Jun 2006 18:23:07 +0000 (18:23 +0000)
committeroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 11 Jun 2006 18:23:07 +0000 (18:23 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2149 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/an1.c

index 00e4ea73509655e0474b8f3614ddecc7a0b00448..134335ee2021a35002e80b864896c6d1b1adc09e 100644 (file)
@@ -304,9 +304,9 @@ void Destroy_AN1_Waypoint( void *vwpt ) {
        an1_waypoint_record *wpt = (an1_waypoint_record *)vwpt;
        xfree( wpt->name );
        xfree( wpt->fontname );
-       xfree( wpt->url );
-       xfree( wpt->comment );
-       xfree( wpt->image_name );
+       if ( wpt->url ) xfree( wpt->url );
+       if ( wpt->comment ) xfree( wpt->comment );
+       if ( wpt->image_name ) xfree( wpt->image_name );
        xfree( vwpt );
 }